//
//  UILabel+Extension.swift
//  weibo
//
//  Created by 张宏芝 on 15/9/6.
//  Copyright © 2015年 kama. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(title:String?,color:UIColor,fontSize:CGFloat,layoutWidth:CGFloat = 0){
//        实例化当前对象
        self.init()
//        设置对象的属性
        text = title
        textColor = color
        font = UIFont.systemFontOfSize(fontSize)
        
        if layoutWidth > 0 {
            preferredMaxLayoutWidth = layoutWidth
            numberOfLines = 0
        }
        sizeToFit()
    }
}























